<!DOCTYPE html>
<html>
<head>
    <meta name="viewport"
          content="width=device-width,height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no">
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="../stylesheets/bootstrap.min.css">
    <!-- 可选的Bootstrap主题文件（一般不用引入） -->
    <link rel="stylesheet" href="../stylesheets/bootstrap-theme.min.css">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="../javascripts/lib/jquery-1.11.1.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="../javascripts/lib/bootstrap.min.js"></script>
    <script src="../javascripts/index.js"></script>
    <title><%= title %></title>
</head>
<body>
<div class="container-fluid">
    <div class="row" style="height:50px;background-color:#000000">
        <div class="col-md-6" style="color: #ffffff;line-height: 50px;font-size: 30px">
            <span>奇妙在线管理系统</span>
        </div>
        <div class="col-md-6" style="text-align: right;line-height: 50px;">
            <a href="/logout" style="color: #ffffff;">退出</a>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-3 col-md-2" style="padding: 0px 0px 0px 5px;">
            <ol class="breadcrumb">
                <li><a href="#">后台管理</a></li>
                <li>结算单管理</li>
            </ol>
            <a href="/index/page?page=1" role="button" class="btn btn-default btn-lg btn-block active">结算单管理</a>
            <a href="/bcdoctor/page?page=1" role="button" class="btn btn-default btn-lg btn-block">医师资格审核</a>
            <a href="/qrcode?page=1" role="button" class="btn btn-default btn-lg btn-block" target="_blank">二维码管理</a>
            <a href="/reset" role="button" class="btn btn-default btn-lg btn-block" target="_blank">密码重置</a>
        </div>
        <div class="col-sm-9 col-md-10" style="padding: 0px 2px 0px 5px;">
            <div class="alert alert-warning alert-dismissible fade in" id="warning-block"
                 style="display: none;text-align: center">
                <button type="button" class="close" onclick="warning('close')">&times;</button>
                <span style="color: red;font-weight: bold">请确认是否已经完成汇款!!</span>
                <button type="button" class="btn btn-danger " style="width: 100px;" onclick="pay()">确认
                </button>
            </div>
            <table class="table table-bordered table-striped table-condensed" style="margin-top:1px">
                <thead style="background-color:beige">
                <td>时间</td>
                <td>咨询师</td>
                <td>接诊次数</td>
                <td>结算金额</td>
                <td>是否支付</td>
                </thead>
                <tbody>
                <% result.payoffs.forEach(function(payoff){ %>
                <tr style="height: 40px;">
                    <td><%= payoff.payoff_date %></td>
                    <td><%= payoff.nickname %></td>
                    <td><%= payoff.payoff_count %></td>
                    <td><%= payoff.income %></td>
                    <% if(payoff.pay == 0) { %>
                    <td>
                        <input type="button" name="pay" value="支付" onclick="warning('open','<%= payoff._id %>')"/>
                    </td>
                    <% } else{ %>
                    <td>
                        <span>已支付</span>
                    </td>
                    <% } %>
                </tr>
                <% }) %>
                </tbody>
            </table>
            <ul class="pagination" style="margin-top: 0px;">
                <% if(parseInt(result.page.current_page) == 1){ %>
                <li><a href="/index/page?page=<%= result.page.current_page %>">&laquo;</a></li>
                <% }else{ %>
                <li><a href="/index/page?page=<%= result.page.current_page - 1 %>">&laquo;</a></li>
                <% } %>

                <% for(var i = 1;i <= result.page.total_page;i++){ %>
                <% j = i %>
                <% if(i == result.page.current_page){ %>
                <li class="active"><a href="/index/page?page=<%= i %>"><%= i %></a></li>
                <% }else{ %>
                <li><a href="/index/page?page=<%= i %>"><%= i %></a></li>
                <% } %>
                <% } %>

                <% if(result.page.current_page == result.page.total_page) { %>
                <li><a href="/index/page?page=<%= result.page.current_page %>">&raquo;</a></li>
                <% }else{ %>
                <li><a href="/index/page?page=<%= parseInt(result.page.current_page) + 1 %>">&raquo;</a></li>
                <% } %>
            </ul>
        </div>
    </div>
    <div class="row" style="position: absolute;height: 35px;background-color: #000000;bottom: 0;width: 100%">

    </div>
</div>
</body>
</html>
